package com.globo.devsup.client.presenter.listener;

import com.globo.devsup.client.presenter.LoginPresenter;
import com.gwtext.client.core.EventObject;
import com.gwtext.client.widgets.Button;
import com.gwtext.client.widgets.Component;
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
import com.gwtext.client.widgets.event.WindowListenerAdapter;

public class LoginListener {

	public static class LoginWindowListener extends WindowListenerAdapter {
		private LoginPresenter presenter;
		
		public LoginWindowListener(LoginPresenter presenter) {
			super();
			this.presenter = presenter;
		}

		public void onShow(Component component) {
			presenter.LOAD_WINDOW_STRATEGY.execute();
			super.onShow(component);
		}
		
	}
	
	public static class SubmitButtonListener extends ButtonListenerAdapter {
		private LoginPresenter presenter;
		
		public SubmitButtonListener(LoginPresenter presenter) {
			super();
			this.presenter = presenter;
		}

		public void onClick(Button button, EventObject e) {
			presenter.SUBMIT_STRATEGY.execute();
			super.onClick(button, e);
		}
	}
}
